/**
 * ...
 * @author Krzysztof Rozalski
 */

package hapi.facebook;

class FacebookUserBasicData {

	var data:Hash<Dynamic>;
	public var id(getId, null):String;
	public var name(getName, null):String;
	public var firstName(getFirstName, null):String;
	public var lastName(getLastName, null):String;
	public var email(getEmail, null):String;
	public var pictureUrl(getPictureUrl, null):String;
	public var profileLink(getProfileLink, null):String;
	public var gender(getGender, null):String;
	public var locale(getLocale, null):String;
	
	public function new(hash) {
		this.data = hash;
	}
	
	function getId() {
		return data.get("id");
	}
	
	function getName() {
		return data.get("name");
	}
	
	function getFirstName() {
		return data.get("first_name");
	}
	
	function getLastName() {
		return data.get("last_name");
	}
	
	function getEmail() {
		return data.get("email");
	}
	
	function getPictureUrl() {
		return "https://graph.facebook.com/" + id + "/picture";
	}
	
	function getProfileLink() {
		return data.get("link");
	}
	
	function getGender() {
		return data.get("gender");
	}
	
	function getLocale() {
		return data.get("locale");
	}
	
	public function toString():String {
		return firstName + " " + name + "(" + id + ")";
	}
}